# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=libretro-bsnes
pkgver=3120
pkgrel=1
epoch=1
pkgdesc='Super Nintendo Entertainment System cores'
arch=(loong64 x86_64)
url=https://github.com/libretro/bsnes-libretro
license=(GPL3)
groups=(libretro)
depends=(
  gcc-libs
  libretro-core-info
)
makedepends=(git)
_commit=22e032a4998161be196d84834303af921e51c0cd
source=(
  libretro-bsnes::git+https://github.com/libretro/bsnes-libretro.git#commit=${_commit}
  libretro-bsnes-flags.patch
)
b2sums=('SKIP'
        'd8d87b92fc0f6d4020333230580bb0e63c73e6833365868f8c71fced923dbbf9df4842d1e7b7fb6bd493ba1e22e53757ae6656a3bcc3408220a18b06f41ea81f')

pkgver() {
  cd libretro-bsnes
  git rev-list --count HEAD
}

prepare() {
  cd libretro-bsnes
  patch -Np1 -i ../libretro-bsnes-flags.patch
}

build() {
  make -C libretro-bsnes/bsnes target=libretro binary=library local=false platform=linux
}

package() {
  install -Dm 644 libretro-bsnes/bsnes/out/bsnes_libretro.so -t "${pkgdir}"/usr/lib/libretro/
}

# vim: ts=2 sw=2 et:
